#include <windows.h>
#include "../common/common.h"
 UINT	MG_KEYDOWN=0,
		MG_KEYUP=0,
		MG_LBUTTONDOWN=0,
		MG_LBUTTONUP=0,
		MG_LBUTTONDBLCLK=0,
		MG_RBUTTONDOWN=0,
		MG_RBUTTONUP=0,
		MG_RBUTTONDBLCLK=0,
		MG_TERMINATE=0,
		MG_NOTHING=0;

int main(int argc, char **argv)
{
	SendMessage(HWND_BROADCAST, MSG_TERMINATE, 0, 0);
	Sleep(1000);
	SC_HANDLE hManager = OpenSCManager(NULL, NULL, SC_MANAGER_ALL_ACCESS);
	if(hManager) {
		SC_HANDLE hService = OpenService(hManager, SERVICE_NAME, SERVICE_ALL_ACCESS);
		if(hService) {
			if(DeleteService(hService)) {
				MessageBox(NULL, "Mathgate service removed successfully", 0, 0);
			}
			else {
				MessageBox(NULL, "Error on deletinng Mathgate service", 0, 0);
			}
		}
		else {
			MessageBox(NULL, "Can't find Mathgate service", 0, 0);
		}
	}
	else {
		MessageBox(NULL, "SCManager open fail!", 0, 0);
	}

	return 0;
}